import { Entity, Column, CreateDateColumn, ManyToOne } from 'typeorm';
import { BaseEntity } from '../../../common/base.entity';
import { RoomManageEntity } from '../../roomManage/entity/roomManage';

@Entity('Order_manage')
export class OrderManageEntity extends BaseEntity {
  @Column({ comment: '预约人' })
  order_name?: string;

  @Column({ comment: '预约房屋名字' })
  room?: string;

  @Column({ comment: '预约房屋ID' })
  room_id?: string

  @Column({ comment: '来源' })
  source?: string;

  @Column({ comment: '联系电话' })
  phone?: string;

  @CreateDateColumn({ comment: '预约时间' })
  order_date?: Date;
  
  @CreateDateColumn({ comment: '预约结束时间' })
  order_end_date?: Date;

  @CreateDateColumn({ comment: '开始计费时间' })
  start_charge_date?: Date;

  @CreateDateColumn({ comment: '开始计费时间' })
  end_charge_date?: Date;

  @Column({ comment: '剩余释放时间' })
  remaining_time?: string;

  @Column({ comment: '状态' })
  status?: string

  @Column({ comment: '房间类型' })
  type?: string

  @ManyToOne(() => RoomManageEntity, (room) => room.ordered_manage)
  rooms?: RoomManageEntity;
}